/**
 * 
 */
package com.qachecklist.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * A Check is the result of testing one Item
 * with one Environment.
 * 
 * @author hirokiterashima
 */
@Entity
@Table(name="checks")
public class Check extends PersistableDomain {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Long id = null;

	@ManyToOne
	@JoinColumn(name="item_fk") 
	private Item item;
	
	@ManyToOne
	@JoinColumn(name="environment_fk") 
	private Environment environment;
	
	@Column(name="pass")
	private boolean pass;
	
	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public Environment getEnvironment() {
		return environment;
	}

	public void setEnvironment(Environment environment) {
		this.environment = environment;
	}

	public boolean isPass() {
		return pass;
	}

	public void setPass(boolean pass) {
		this.pass = pass;
	}

	/**
	 * @see com.qachecklist.domain.PersistableDomain#getObjectClass()
	 */
	@Override
	protected Class<Check> getObjectClass() {
		return Check.class;
	}

	@Override
	public String toXMLString() {
		return null;
	}

}
